package com.jsg.sl651.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 流域区代码
 */
@AllArgsConstructor
@Getter
public enum WatershedCode {
    HLJ_LY(1,"黑龙江流域"),
    LH_LY(2,"辽河流域"),
    HH_0_LY(3,"海河流域"),
    HH_1_LY(4,"黄河流域"),
    HH_2_LY(5,"淮河流域"),
    CJ_LY(6,"长江流域"),
    ZMT_LY(7,"浙闽台流域"),
    ZJ_LY(8,"珠江流域"),
    ZNDX_LYQ(9,"藏南滇西河流河区"),
    NLHHJXJW_LHQ(0,"内陆河湖及新疆流河区"),
    UNKNOWN(-1,"未知流域");
    ;
    private final int code;
    private final String name;

    public static WatershedCode getByCode(int code) {
        for (WatershedCode item : WatershedCode.values()) {
            if (item.getCode() == code) {
                return item;
            }
        }
        return UNKNOWN;
    }
}
